'''
Created on 17/11/2013

@author: root
'''
import urllib
'''
Created on 14/11/2013

@author: root
'''
class Breadcrumb():
    def __init__(self,description,slug,bread):
        self.description = description
        self.slug = slug
        self.bread = bread
    def __str__(self):
        return self.description + "-" + self.slug
        
class MapperUrl():
    
    def createUrlFilter(self,key,dictionaryFilter):
        filters = ['tags',    'cat',    'zones.desc',    'szones.desc',    'date']
        url_suffix = ''
        for selected in dictionaryFilter.keys():
            filters.remove(selected)
            if selected == 'tags':
                url_suffix += selected + '_' + '-'.join(dictionaryFilter[selected]['$all']) + "__"
            else:
                url_suffix += selected + '_' + dictionaryFilter[selected] + "__"
        result= key + '_<value>__' + url_suffix 
        return result[:-2]
             
if __name__ == '__main__':
    results=MapperUrl().createUrlFilter('zones.desc',{u'cat': u'cientificoinvestigacion',u'tags': u'java'})
    print results



